if exists (select 1
            from  sysobjects
           where  id = object_id('bd_view_user')
            and   type = 'V')
   drop view bd_view_user
go

/*==============================================================*/
/* View: bd_view_user                                           */
/*==============================================================*/
create view bd_view_user as
SELECT
  u.user_serial
 ,u.user_no
 ,u.user_card
 ,u.user_lname AS user_name
 ,u.user_dep AS dept_serial
 ,d.dep_name AS dept_name
 ,u.kqdkLx
FROM dbo.dt_user AS u
LEFT JOIN dbo.dt_dep AS d
  ON d.dep_serial = u.user_dep
WHERE (u.user_type <> 51)
go
